/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.uch.util;

import net.uch.commonService.ServiceFinder;
import net.uch.biblioteca.hibernateSpringDao.*;



/**
 *
 * @author USUARIO
 */
public class CommonDAO {

    
    private static HSTbCatalogoDAO m_tbCatalogoDAO;
    private static HSTbRolesDAO m_tbRolesDAO;
    private static HSBibUsuarioDAO m_bibUsuarioDAO;
    private static HSBibLectorDAO m_bibLectorDAO;
    private static HSBibCatalogoDAO m_bibCatalogoDAO;
    private static HSBibCatalogoDetalleDAO m_bibCatalogoDetalleDAO;
    private static HSBibEjemplarDAO m_bibEjemplarDAO;
    private static HSBibPrestamoDAO m_bibPrestamoDocDAO;
    private static HSBibDevolucionDAO m_bibDevolucionDAO;
    

    public static HSTbCatalogoDAO getTbCatalogoDAO() {
        if ( m_tbCatalogoDAO == null ) {
            m_tbCatalogoDAO = (HSTbCatalogoDAO) ServiceFinder.findBean( ConstantesWeb.SHDAO_TB_CATALOGO );
        }
        return m_tbCatalogoDAO;
    }
    
    public static HSTbRolesDAO getTbRolesDAO() {
        if ( m_tbRolesDAO == null ) {
            m_tbRolesDAO = (HSTbRolesDAO) ServiceFinder.findBean( ConstantesWeb.SHDAO_TB_ROLES);
        }
        return m_tbRolesDAO;
    }

    public static HSBibUsuarioDAO getBibUsuarioDAO () {
        if ( m_bibUsuarioDAO == null ) {
            m_bibUsuarioDAO = (HSBibUsuarioDAO) ServiceFinder.findBean( ConstantesWeb.SHDAO_BIB_USUARIO);
        }
        
        return m_bibUsuarioDAO;
    }
    
    public static HSBibLectorDAO getBibLectorDAO () {
        if ( m_bibLectorDAO == null ) {
            m_bibLectorDAO = (HSBibLectorDAO) ServiceFinder.findBean( ConstantesWeb.SHDAO_BIB_LECTOR);
        }
        
        return m_bibLectorDAO;
    }
    
    public static HSBibCatalogoDAO getBibCatalogoDAO () {
        if ( m_bibCatalogoDAO == null ) {
            m_bibCatalogoDAO = (HSBibCatalogoDAO) ServiceFinder.findBean( ConstantesWeb.SHDAO_BIB_CATALOGO);
        }
        
        return m_bibCatalogoDAO;
    }
    
    public static HSBibCatalogoDetalleDAO getBibCatalogoDetalleDAO () {
        if ( m_bibCatalogoDetalleDAO == null ) {
            m_bibCatalogoDetalleDAO = (HSBibCatalogoDetalleDAO) ServiceFinder.findBean( ConstantesWeb.SHDAO_BIB_CATALOGO_DETALLE);
        }
        
        return m_bibCatalogoDetalleDAO;
    }
    
    public static HSBibEjemplarDAO getBibEjemplarDAO () {
        if ( m_bibEjemplarDAO == null ) {
            m_bibEjemplarDAO = (HSBibEjemplarDAO) ServiceFinder.findBean( ConstantesWeb.SHDAO_BIB_EJEMPLAR);
        }
        
        return m_bibEjemplarDAO;
    }
    
    public static HSBibPrestamoDAO getBibPrestamoDocDAO () {
        if ( m_bibPrestamoDocDAO == null ) {
            m_bibPrestamoDocDAO = (HSBibPrestamoDAO) ServiceFinder.findBean( ConstantesWeb.SHDAO_BIB_PRESTAMO_DOC);
        }
        
        return m_bibPrestamoDocDAO;
    }
    
    public static HSBibDevolucionDAO getDevolucionDAO () {
        if ( m_bibDevolucionDAO == null ) {
            m_bibDevolucionDAO = (HSBibDevolucionDAO) ServiceFinder.findBean( ConstantesWeb.SHDAO_BIB_DEVOLUCION_DOC);
        }
        
        return m_bibDevolucionDAO;
    }
}
